package com.itheima.mapper;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserMapper {
    @Select("select * from user")
    List<User> findAll();

    @Insert("insert into user values(id,#{username},#{email})")
    void insertInfo(User user);

    @Select("select * from user where id=#{id}")
    User findById(int id);

    @Update("update user set username=#{username},email=#{email} where id=#{id}")
    void update(User user);

    @Delete("delete from user where id=#{id}")
    void delete(int id);
}
